using System;
using System.Collections.Generic;
using System.Text;

namespace Eve.Data
{
    public class Flag : EveProperty
    {
        private string flagName;
        private string flagText;
        private string flagType;
        private int orderId;

        public string Name
        {
            get { return flagName; }
        }
        public string Text
        {
            get { return flagText; }
        }
        public string Type
        {
            get { return flagType; }
        }
        public int OrderId
        {
            get { return orderId; }
        }

        internal Flag(DbDataRow dr)
            : base(dr.Database, EvePropertyType.Flag, dr["flagID"])
        {
            Fill(dr);
        }
        internal Flag(Database db, int id)
            : base(db, EvePropertyType.Flag, id)
        {
            Fill(db.ExecuteSingle("SELECT * FROM invFlags WHERE flagID=" + id));
        }

        private void Fill(DbDataRow dr)
        {
            flagName = dr["flagName"];
            flagText = dr["flagText"];
            flagType = dr["flagType"];
            orderId = dr["orderID"];
        }
    }
}
